#include "stdafx.h"
#include "OrthoViewVolume.h"
#include "glu.h"

//-------------------------------------------------------------------------
// constructors
//-------------------------------------------------------------------------

COrthoViewVolume::COrthoViewVolume()
{
}

//-------------------------------------------------------------------------
// functions
//-------------------------------------------------------------------------

void COrthoViewVolume::OnWindowResize()
{
	// Redefine the viewport to prevent distortion of image

	glViewport(m_nWndOriginX, m_nWndOriginY, m_nWndWidth, m_nWndHeight);

	// Set projection matrix to orthographic for 2D

	glMatrixMode(GL_PROJECTION);
	glLoadIdentity();
	gluOrtho2D(m_nWndOriginX, m_nWndWidth, m_nWndOriginY, m_nWndHeight); // bottom left screen set to (m_fWndOriginX,m_fWndOriginY)

	// Set matrix mode to model for screen geometry

	glMatrixMode(GL_MODELVIEW);
	glLoadIdentity();
}